package keter.sec.springsec.controller;

import keter.sec.springsec.model.MyUserDetails;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;

/**
 * Created by gkatzioura on 9/2/16.
 */
@Controller
public class BaseController{

	protected MyUserDetails getCurrentUser() {
		Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return (MyUserDetails) principal;
	}
}
